home *** CD-ROM | disk | FTP | other *** search
/ Developer CD Series 1994 June: Reference Library / Dev.CD Jun 94.toast / Periodicals / develop / develop Issue 11 / develop 11 code / MultiBuffer / MultiBuffer Source / BuildDoubleBuffer < prev    next >
Encoding:
Text File  |  1992-07-15  |  2.9 KB  |  115 lines  |  [TEXT/MPS ]

  1. # to build the applicaiton execute the following line on the worksheet
  2. #
  3. #        BuildDoubleBuffer
  4. #
  5. # there are some build options which can be added after the above command:
  6. #
  7. #        -e            build everything
  8. #        -Debug        include any asserts used with debugging
  9. #        -Verbose    include message displayed in the debugger
  10. #
  11. # for example, to build a fully debug version with messages you execute:
  12. #
  13. #        BuildDoubleBuffer -Debug -Verbose
  14. #
  15. # NOTE: it may be necessary to use the -e (build everything) option if you've
  16. #        already built some of the objects but later changed an option.  This is
  17. #        necessary after building a -Debug version and then requesting -Verbose
  18.  
  19.  
  20. # set the default options
  21. Set COptions "{COptions} -opt full -r -mbg off -d _DEBUG=false -d _VERBOSE=false"
  22. Set ROptions "-d forRez -d SystemSevenOrLater=1 -append"
  23.  
  24.  
  25. # if no parameters were passed, then we're doing a non-debug version
  26. If {#} == 0
  27.     Set ObjFolder :NonDebugObjects:
  28.     Set COptions "{COptions} -k {ObjFolder}"
  29. Else
  30.  
  31.     # now we're building a debug version, check for the options
  32.     # if an option is true then replace the default setting for the new one
  33.     Loop
  34.         If "{1}" == "-Debug"
  35.             If "{COptions}" =~ /(≈)®1_DEBUG=false(≈)®2/
  36.                 Set COptions "{®1}_DEBUG=true{®2}"
  37.             End
  38.             If "{COptions}" =~ /(≈)®1mbg off(≈)®2/
  39.                 Set COptions "{®1}mbg on{®2}"
  40.             End
  41.         Else If "{1}" == "-Verbose"
  42.             If "{COptions}" =~ /(≈)®1_VERBOSE=false(≈)®2/
  43.                 Set COptions "{®1}_VERBOSE=true{®2}"
  44.             End
  45.             If "{COptions}" =~ /(≈)®1mbg off(≈)®2/
  46.                 Set COptions "{®1}mbg on{®2}"
  47.             End
  48.         Else If "{1}" == "-e"
  49.                 Set MOptions "-e"
  50.         
  51.         # check for any unknown option
  52.         Else
  53.             Echo "Illegal option: {1}" > dev:StdErr
  54.             Exit 1
  55.         End
  56.         
  57.         # shift to the next parameter and test the loop conditional
  58.         Shift
  59.         Break If {#} == 0
  60.     End
  61.  
  62.     # since we're building a debug version put it into in debugging folder
  63.     Set ObjFolder :DebugObjects:
  64.     Set COptions "{COptions} -k {ObjFolder}"
  65. End
  66.  
  67. # make sure the object folders are available
  68. Export ObjFolder
  69. If !`Exists "{ObjFolder}" -d`
  70.     NewFolder "{ObjFolder}"
  71. End
  72.  
  73. # create the make script
  74. Make "{ObjFolder}"DoubleBuffer                        ∂
  75.                 -d COptions="{COptions}"            ∂
  76.                 -d ROptions="{ROptions}"            ∂
  77.                 "{MOptions}" > MakeOut
  78.  
  79. # write progress output to the user's worksheet
  80. Begin
  81.     Echo ∂n
  82.     Echo "———————————————————————"
  83.     Echo -n ∂t"◊ "
  84.     Date -a
  85.     Set StartTime `Date -n`
  86.     
  87.     MakeOut
  88.     Delete MakeOut -i
  89.     
  90.     Set TimeNow `Date -n`
  91.     Set Elapsed `Evaluate {TimeNow}-{StartTime}`
  92.     Echo "———————————————————————"
  93.     Set Elapsed "`Date -c {Elapsed} -t`"
  94.     If "{Elapsed}" =~ /12:([0-9]+:[0-9]+)®1 [AP]M/
  95.         Set Elapsed "0:{®1}"
  96.     Else If "{Elapsed}" =~ /0*([0-9]+:[0-9]+:[0-9]+)®1 [AP]M/
  97.         Set Elapsed "{®1}"
  98.     End
  99.     Echo "∂t◊ Build time: {Elapsed}"
  100.     Echo "———————————————————————"
  101.     
  102.     # output the name of the build and select it for the user
  103.     Echo ∂t∂""{ObjFolder}"DoubleBuffer∂"
  104.     Find ¡2 "{Worksheet}"
  105.     Find /∂"/Δ:Δ/∂"/  "{Worksheet}"
  106.     
  107.     Unset StartTime
  108.     Unset TimeNow
  109.     Unset Elapsed
  110. End ∑∑ "{Worksheet}"
  111.  
  112. Exit
  113. #
  114.  
  115.